@extends('admin.layout.base')
@section('title', '查看系统消息')
@section('content')
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            查看系统消息
        </h1>
        <ol class="breadcrumb">
            <li><a href="{{ url('/admin') }}"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="{{ url('/admin/message') }}">系统消息管理</a></li>
            <li class="active">查看消息</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <!-- right column -->
            <div class="col-md-12">
                <!-- Horizontal Form -->
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">查看消息</h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form class="form-horizontal" action="{{ url('/admin/message',['id'=>$message->id]) }}" method="post">
                        {!! csrf_field() !!}
                        {{ method_field('PUT') }}
                        <div class="box-body">
                            @if(isset($error))
                            <div class="alert alert-danger">{{ $error }}</div>
                            @endif
                            <div class="form-group">
                                <label class="col-sm-2 control-label">消息标题</label>
                                <div class="col-sm-5">
                                    <p class="form-control-static">{{ $message->msg_title }}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">消息类型</label>
                                <div class="col-sm-3">
                                    @if($message->msg_type == 1)
                                        会员消息
                                    @elseif($message->msg_type == 2)
                                        管理员消息
                                    @else
                                        系统消息
                                    @endif
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">消息内容</label>
                                <div class="col-sm-8">
                                    <p class="form-control-static">{{ $message->msg_content }}</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否删除</label>
                                <div class="col-sm-8 radio">
                                    <label>
                                        <input type="radio" name="msg_status" id="" value="0"/>是 
                                    </label>
                                    <label>
                                        <input type="radio" name="msg_status" id="" value="1" checked/>否
                                    </label>
                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                        <div class="box-footer">
                            <button type="button" class="btn btn-default" onclick="history.go(-1)">返回</button>
                            <button type="submit" class="btn btn-info pull-right">保存</button>
                        </div>
                        <!-- /.box-footer -->
                    </form>
                </div>
                <!-- /.box -->
            </div>
            <!--/.col (right) -->
        </div>
        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>
@endsection
@section('pluginscript')
<!-- FastClick -->
<script src="{{ asset('/dist/admin/plugins/fastclick/fastclick.js') }}"></script>
<script type="text/javascript">
    $(function(){
        $('#msg_type').change(function(){
            if ($(this).val() == 1) {
                $('#user_id').attr('type', 'text');
                $('#user_id').val('');
            } else {
                $('#user_id').attr('type','hidden');
                $('#user_id').val(0);
            }
        });
    });
</script>
@endsection